/* This file is part of SpaceSim.
 
 SpaceSim is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 SpaceSim is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with SpaceSim.  If not, see <http://www.gnu.org/licenses/>. */

#include <SFML/Graphics.hpp>

#include <stack>

#ifndef GRAPHICS_H
#define GRAPHICS_H

namespace Graphics {
	// App is the window in which the drawing takes place
	extern sf::RenderWindow App;
	// A view centered on the player
	extern sf::View PlayerCenter;
	// This enum defines the types of drawing we're going to do
	namespace ViewMode {
		enum Enum {
			NoView,			// if the viewmode is undefined - sound the alarm when trying to draw this
			SystemView,		// planets and the sun
			ErrorView,		// something caused an error
			SystemInfoView,	// describe the planets and stuff
			WarpSelectView,	// select the in-cluster warp location
			WarpHubView,	// select the warp hubs
			StationView,	// contains missions and stuff
			MissionView		// displays the active mission b/w info
		};
	}
	// The ViewStack contains the viewmodes we would like to draw
	/* Why a stack? Say you land on a planet, then enter a shipyard, and look at your missions
	 * When you exit the top viewmode (mission) the one below (shipyard) is activated, and
	 * the player is not pushed back into space.
	 */
	extern std::stack<ViewMode::Enum> ViewStack;
	
	// This should select the appropriate draw function
	void Draw();
	
	// The error message
	extern sf::String ErrorString;
	
	// How far the view is zoomed in
	extern float ZoomFactor;
}

#ifdef GRAPHICS_CPP
	
namespace GraphicsPrivate {
	void DrawNoView();
	void DrawSystemView();
	void DrawErrorView();
	void DrawSystemInfoView();
	void DrawWarpSelectView();
	void DrawWarpHubView();
	void DrawStationView();
	void DrawMissionView();
}

#endif

#endif